package com.anolesoft.amljmes.screen.controller;

import com.anolesoft.amljmes.screen.dto.MesOrderAssess;
import com.anolesoft.amljmes.screen.dto.MesOrderTimeoutLogs;
import com.anolesoft.amljmes.screen.service.MesOrderTimeoutLogsService;
import com.anolesoft.amljmes.screen.vo.MesOrderViewVo;
import com.anolesoft.common.core.constant.HttpStatus;
import com.anolesoft.common.core.web.domain.AjaxResult;
import com.anolesoft.yr.demo.PageResult;
import com.anolesoft.yr.util.Constants;
import com.anolesoft.yr.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/messcreen")
public class MesOrderTimeoutLogsController {

    @Autowired
    private MesOrderTimeoutLogsService service;

    @RequestMapping(value = "/querydata" , method = RequestMethod.POST)
    public AjaxResult queryScreen(@RequestBody MesOrderTimeoutLogs mesOrderTimeoutLogs){
        String jx = mesOrderTimeoutLogs.getJx();
        List<MesOrderViewVo> list =  service.querytongji(jx);
        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,list);
    }

    @RequestMapping(value = "/querymingxi" , method = RequestMethod.POST)
    public AjaxResult queryScreenmingxi(@RequestBody MesOrderTimeoutLogs mesOrderTimeoutLogs){
        Integer pageNo = mesOrderTimeoutLogs.getPageNum();
        Integer pageSize = mesOrderTimeoutLogs.getPageSize();
        PageResult pageResult =  service.querymingxi(mesOrderTimeoutLogs);
        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,pageResult);
    }

    @RequestMapping(value = "/kaohejianyi" , method = RequestMethod.POST)
    public AjaxResult updatekaohe(@RequestBody MesOrderAssess mesOrderAssess){
        int a = service.insertkaohe(mesOrderAssess);
        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,a);
    }


    @RequestMapping(value = "/tianbao" , method = RequestMethod.POST)
    public AjaxResult updatetianbao(@RequestBody MesOrderAssess mesOrderAssess){
        int a = service.updatereason(mesOrderAssess);
        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,a);
    }

    @RequestMapping(value = "/shengchan" , method = RequestMethod.POST)
    public AjaxResult updateshengchan(@RequestBody MesOrderAssess mesOrderAssess){
        int a = service.updateshengchan(mesOrderAssess);
        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,a);
    }

    @RequestMapping(value = "/jishu" , method = RequestMethod.POST)
    public AjaxResult updatejishu(@RequestBody MesOrderAssess mesOrderAssess){
        int a = service.updatejishu(mesOrderAssess);
        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,a);
    }

    @RequestMapping(value = "/zhiliang" , method = RequestMethod.POST)
    public AjaxResult updatezhiliang(@RequestBody MesOrderAssess mesOrderAssess){
        int a = service.updatezhiliang(mesOrderAssess);
        return new AjaxResult(HttpStatus.SUCCESS, Constants.QUERY_SUCCESS_MESSAGE,a);
    }

}
